﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <meta charset="utf-8">
    <include file="../inc/meta.inc" />
    <title>考试中...</title>
</head>

<body>
    <div id="vapp" v-cloak>
        <page_header ref="header" :organ="organ" @login="acc=>account=acc"
            @load="(o,c,p)=>{organ=o;config=c;platinfo=p;}">loading ...</page_header>
        <context class="breadcrumb">
            <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item><a href="/">首页</a></el-breadcrumb-item>
                <el-breadcrumb-item><a href="/web/Course">课程中心</a></el-breadcrumb-item>
                <el-breadcrumb-item><a :href="'/web/course/detail.'+paper.Cou_ID">《{{paper.Cou_Name}}》</a>
                </el-breadcrumb-item>
                <el-breadcrumb-item v-if="paper.Tp_IsFinal">结课考试</el-breadcrumb-item>
                <template v-else>
                    <el-breadcrumb-item>模拟测试</el-breadcrumb-item>
                    <el-breadcrumb-item>{{paper.Tp_Name}}
                    </el-breadcrumb-item>
                </template>
            </el-breadcrumb>
        </context>
        <nologin v-if="!islogin" remark="未登录"></nologin>
        <context v-else-if="!canstudy && isoverdue" class="course_end">
            <icon>&#xe671</icon>未选修当前课程，或已经过期
        </context>

        <final_condition ref="final_condition" v-show="paper.Tp_IsFinal" class="condition" :config="config" :purchase="purchase" :paperid="tpid"
            :account="account">
            <el-divider>参加结课考试的条件</el-divider>
        </final_condition>

        <context id="scene" v-if="!final_disable() && islogin" remark="考试区域">
            <div class="testinfo" remark="试卷信息区域">
                <loading class="loading_init" v-if="loading.init">加载初始数据...</loading>
                <template v-else>
                    <div class="remaining" @click="showExam=true">
                        <icon>&#xe81a</icon> {{surplustime|surplus}}
                    </div>
                    <answercard ref='answercard' :questions="paperAnswer.ques" :types="types" :index="swipeIndex">
                    </answercard>
                    <div id="btnSubmit" icon="&#xe6cf" @click="submitManual">
                        交&nbsp;卷</div>
                </template>
            </div>
            <div class="exam">
                <div class="move_btn">
                    <span @click="swiperight()">
                        <icon>&#xe803</icon>上一题
                    </span>
                    <span @click="swipeleft()">
                        <icon>&#xe802</icon>下一题
                    </span>
                </div>
                <section :style="'width:'+questotal*800+'px'" v-swiperight="swiperight" v-swipeleft="swipeleft"
                    remark="试题区域">
                    <template v-if="!loading.paper">
                        <dl v-for="(group,i) in paperQues" :style="'width:'+group.count*800+'px'">
                            <question v-for="(q,n) in group.ques" :ques="q" :index="n" :groupindex="i" :types="types"
                            :swipeindex="swipeIndex" :total="questotal" :groups="paperQues">
                            </question>
                        </dl>
                    </template>
                    <div class="loading_paper" v-else>
                        <loading type="spinner" size="24px">试题加载中...</loading>
                    </div>
                </section>
            </div>
        </context>
        <el-dialog :visible.sync="submitState.show" class="submitState" :append-to-body="true"
            :close-on-click-modal="false" :show-close="false">
            <template slot="title">
                <loading v-if="submitState.loading">成绩提交中...</loading>
                <span v-else>成绩提交成功！</span>
            </template>
            <div class="submitSuccess">
                <loading v-if="submitState.loading">成绩提交中...</loading>
                <template v-else>
                    <div>得分：<b v-html="submitState.result.score"></b> 分 </div>
                    <div class="pager_total">
                        总 分：{{paper.Tp_Total}} 分 / {{paper.Tp_PassScore}}分及格
                    </div>
                </template>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="goback">确 定</el-button>
            </span>
        </el-dialog>
        <page_footer :organ="organ" :account="account">loading ...</page_footer>
    </div>
</body>

</html>